import { createRouter, createWebHashHistory } from "vue-router";

import home from "./modules/home";


const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: "/industry",
      name: "industry",
      component: () => import("@/views/layout/IndustryLayout.vue"),
      children: [
        {
          path: "industrialPlanning",
          name: "industrialPlanning",
          component: () => import("@/views/IndustrialPlanning/index.vue"),
          meta: {
            name: "产业规划",
          },
        },
        {
          path: "industryResources",
          name: "industryResources",
          component: () => import("@/views/IndustryResources/index.vue"),
          meta: {
            name: "产业资源",
          },
        },
        {
          path: "supplyDemand",
          name: "supplyDemand",
          component: () => import("@/views/SupplyDemand/index.vue"),
          meta: {
            name: "供需监测",
          },
        },
        {
          path: "industrialOperation",
          name: "industrialOperation",
          component: () => import("@/views/IndustrialOperation/index.vue"),
          meta: {
            name: "产业运营",
          },
        },
        {
          path: "agriculturalServices",
          name: "agriculturalServices",
          component: () => import("@/views/AgriculturalServices/index.vue"),
          meta: {
            name: "农事服务",
          },
        },

        {
          path: "digitalTransformation",
          name: "digitalTransformation",
          component: () => import("@/views/DigitalTransformation/index.vue"),
          meta: {
            name: "数字转型",
          },
        },
        {
          path: "GAPPromotion",
          name: "GAPPromotion",
          component: () => import("@/views/GAPPromotion/index.vue"),
          meta: {
            name: "GAP推广",
          },
        },


      ],
    },
    {
      path: "/base",
      name: "base",
      component: () => import("@/views/layout/BaseLayout.vue"),
      children: [
        {
          path: "BaseOverview",
          name: "BaseOverview",
          component: () => import("@/views/BaseOverview/index.vue"),
          meta: {
            name: "基地总览",
          },
        },
        {
          path: "DigitalPlanting",
          name: "DigitalPlanting",
          component: () => import("@/views/DigitalPlanting/index.vue"),
          meta: {
            name: "数字种植",
          },
        },
        {
          path: "DigitalManagement",
          name: "DigitalManagement",
          component: () => import("@/views/DigitalManagement/index.vue"),
          meta: {
            name: "数字管理",
          },
        },
        {
          path: "DigitalPlants",
          name: "DigitalPlants",
          component: () => import("@/views/DigitalPlants/index.vue"),
          meta: {
            name: "数字植株",
          },
        },
      ]
    },
    {
      path: "/",
      redirect: "/industry/industrialOperation",
    },
    {
      path: "/login",
      name: "login",
      component: () => import("@/views/Login.vue"),
      meta: {
        name: "登录",
      },
    },


    home,

    {
      path: "/:pathMatch(.*)*",
      name: "404",
      component: () => import("@/views/404.vue"),
    },
  ],
});



export default router;
